package com.xinzhi.savingpot.userinfo.controller;

import com.aliyuncs.exceptions.ClientException;
import com.xinzhi.savingpot.userinfo.service.impl.RegisterServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Register")
@Api("注册页面")
@CrossOrigin
public class RegisterController {
    @Autowired
    private RegisterServiceImpl iRegisterService;


    @GetMapping("/registration")
    @ApiOperation("注册")
    public String Register(@RequestParam("phone") String phone,@RequestParam("password") String password,@RequestParam("Code")String Code,
                           @RequestParam("twoPassword") String twoPassword)  {
        return iRegisterService.register(phone,password,Code,twoPassword);

    }


    @GetMapping("/sendCode")
    @ApiOperation("获取验证码")
    public String yan(@RequestParam("phone")String phone){
        return iRegisterService.sendCode(phone);
    }
}
